﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Bas0a05
    {
        private int? _taxcode;
		private string _taxname;
		private double _taxpct;
		private string _muser;
		private string _listid;
		
        /// <summary>
        /// 税率代码
        /// </summary>
		public int? Taxcode
		{
			get { return _taxcode;	 }
			set { _taxcode=value;	}
		}
        /// <summary>
        /// 税率名称
        /// </summary>
		public string Taxname
		{
			get { return _taxname;	 }
			set { _taxname=value;	}
		}
        /// <summary>
        /// 税率
        /// </summary>
		public double Taxpct
		{
			get { return _taxpct;	 }
			set { _taxpct=value;	}
		}
        /// <summary>
        /// 用户标识
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
		
		public static List<Bas0a05> GetBas0a05ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Bas0a05> list = new List<Bas0a05>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Bas0a05 model = GetBas0a05ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Bas0a05 GetBas0a05ByDataRow(DataRow dr)
		{
			Bas0a05 model = new Bas0a05(); //实例化Bas0a05
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("taxcode")&&!(dr["taxcode"] is System.DBNull))  
				model.Taxcode = ( int)dr["taxcode"];
			if (dcc.Contains("taxname")&&!(dr["taxname"] is System.DBNull))  
				model.Taxname = ( string)dr["taxname"];
			if (dcc.Contains("taxpct")&&!(dr["taxpct"] is System.DBNull))  
				model.Taxpct = Convert.ToDouble(dr["taxpct"]);
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			
			return model;
		}
    }
}
